//
// Created by weicj1 on 2025/1/9.
//
#include "com_dflzm_apidemo_manager_CarManager.h"
#include <string>

bool isOpen = false;

extern "C" JNIEXPORT jstring JNICALL Java_com_dflzm_apidemo_manager_CarManager_getCarInfo (JNIEnv *env, jclass) {
    std::string hello = "Hello from C++";
    return env->NewStringUTF(hello.c_str());
}

extern "C" JNIEXPORT jboolean JNICALL Java_com_dflzm_apidemo_manager_CarManager_setCarSwitch (JNIEnv *env, jclass, jboolean b) {
    isOpen = b==JNI_TRUE;
    return isOpen;
}

extern "C" JNIEXPORT jboolean JNICALL Java_com_dflzm_apidemo_manager_CarManager_getCarSwitch (JNIEnv *env, jclass) {
    return isOpen;
}

